UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o9qfxdYSgsetbWvMv+Slqc9mfX23ovuYXvrjYMxtI0s=' 
WHERE 
  key_id = '1434c44f6003aa631fe944175260454f4af0221e6702e6f933a58a5cdfded0fa' 
  AND (
    token = 'o9qfxdYSgsetbWvMv+Slqc9mfX23ovuYXvrjYMxtI0s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032