UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XxdZvD83keRNpe4a7UunLQ3WGV2tEh+PPeeLFNIskgw=' 
WHERE 
  key_id = '4657b0a5124521c58cf3c716ac8b06283f95f336e9a6c46a0a580a6ac074e5bf' 
  AND (
    token = 'XxdZvD83keRNpe4a7UunLQ3WGV2tEh+PPeeLFNIskgw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026