UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+oRKq4xujIhydieY6eb0kS/FgqNaLK/VpbfNR05w1Ew=' 
WHERE 
  key_id = '4b460e8976c113bbaa187306038f0e528753d073749b3bf799a19a4eb2552b26' 
  AND (
    token = '+oRKq4xujIhydieY6eb0kS/FgqNaLK/VpbfNR05w1Ew=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054