UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3e3qEZ/yZaTSacA3n8JOicfwivek9U1tfkODtjD9X10=' 
WHERE 
  key_id = 'f6eb1e2c2d3b544bbf451589c338f104d33c5cea1a75fa58ec9a3dc2376a988a' 
  AND (
    token = '3e3qEZ/yZaTSacA3n8JOicfwivek9U1tfkODtjD9X10=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044