UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qyUMx8V2DNElLLrounIZm+Jl/4sI0XL7b8DpiFlXtxA=' 
WHERE 
  key_id = '71d441b660b8d1edbbc80fec356186ce6e89495f3ba547ca3d53c6edb504cb29' 
  AND (
    token = 'qyUMx8V2DNElLLrounIZm+Jl/4sI0XL7b8DpiFlXtxA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017