UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RQ+XfkiyVL3MfWlMOrZOMhYuERlnU3gGwnZQSq1S/ic=' 
WHERE 
  key_id = '6db9edf1c276c6f084fa254ea367311094ca0bcc45b22a97c25663510ffb111d' 
  AND (
    token = 'RQ+XfkiyVL3MfWlMOrZOMhYuERlnU3gGwnZQSq1S/ic=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016