UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kSTkAS0g16r4ydGwdC1i7unFshVRffI6T3S7pljRdtw=' 
WHERE 
  key_id = '421b286d9c5c95ea93d269016c81bdd6b2783ce370836286aab68b2fc2def693' 
  AND (
    token = 'kSTkAS0g16r4ydGwdC1i7unFshVRffI6T3S7pljRdtw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038