UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fKmtcneU2+eaxT4aqssDw+6cnHqyQoofR/m5MHQ4Gng=' 
WHERE 
  key_id = '24ff1e822f38bb6db689f3536672cdf75f5f672165734b5d5c74e2af4fd26435' 
  AND (
    token = 'fKmtcneU2+eaxT4aqssDw+6cnHqyQoofR/m5MHQ4Gng=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028