UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TPkq6/gt5ZhBf5Huzgov5/T1j2KNmDL11GO8wmG2h+E=' 
WHERE 
  key_id = '5fe41f003c080090ef27ab6ecc121efb54acbc39aab96de29c7363c9b77627a5' 
  AND (
    token = 'TPkq6/gt5ZhBf5Huzgov5/T1j2KNmDL11GO8wmG2h+E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031