UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l5u70AMG/wypvZuOiqfzPEHeQ3wW6Lr+FchRiIsNIdY=' 
WHERE 
  key_id = '4e49bd91f8def8c9b52f194f8d0c224f25d4e47f1f9e1e653735610975fcc150' 
  AND (
    token = 'l5u70AMG/wypvZuOiqfzPEHeQ3wW6Lr+FchRiIsNIdY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043