UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '//5Wq2L9URfhEXAQS45+h9YrTfq3ATzQlmJYeFKpgLw=' 
WHERE 
  key_id = '924034a9d078e24f37b556b73b414a9efcb1e0dd1f727705a1c038a90ea9196d' 
  AND (
    token = '//5Wq2L9URfhEXAQS45+h9YrTfq3ATzQlmJYeFKpgLw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019