UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gzOTYZ7PGuaKmtZp2ahuZHtDO34v0ZUv/YduWsiBzAs=' 
WHERE 
  key_id = '2b60202aad8a5611c4bdd7c25cbf3142b93a4ca249dc0d363d87f45b47b8da4c' 
  AND (
    token = 'gzOTYZ7PGuaKmtZp2ahuZHtDO34v0ZUv/YduWsiBzAs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020