UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GilwStFvKidLNLQvlqnx93r0hb7C8CQtvLXLeYIQcqM=' 
WHERE 
  key_id = 'de90b0897ded41e01380608851584c5c71e1b2ac3cee4bbef927b2df5fdc226d' 
  AND (
    token = 'GilwStFvKidLNLQvlqnx93r0hb7C8CQtvLXLeYIQcqM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020