UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FSL3OFOzIgXzrXic07aYaKEs3YogU4pNN4bJAadRNwQ=' 
WHERE 
  key_id = '8c151f1b9df7b5afbc796e4e5f1907c79346abe1d7d57f292c6b316c6ef6ec8a' 
  AND (
    token = 'FSL3OFOzIgXzrXic07aYaKEs3YogU4pNN4bJAadRNwQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035