UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GY0Py4EBiHTeua+J6Ifo4w5wbpWhn4o8O4rC2SLB9OQ=' 
WHERE 
  key_id = '1ffd0f1f4a81640f5d15bee2cb9a32b2a12170e60e9167956ff4db1f7083215e' 
  AND (
    token = 'GY0Py4EBiHTeua+J6Ifo4w5wbpWhn4o8O4rC2SLB9OQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027