UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MEc8CnhCkmc5Hm5aJdTXs4AvdYVtzjeVKCOH5RLIBAA=' 
WHERE 
  key_id = '825750afb3813445aebd52269334fb15accb225310e3c4e472332ce7c8e6bf92' 
  AND (
    token = 'MEc8CnhCkmc5Hm5aJdTXs4AvdYVtzjeVKCOH5RLIBAA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035