UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1sreG4fjoORXro/2w1yFPRywoCcPqESRrBxrtqPYkv8=' 
WHERE 
  key_id = '69aab114a2663f8f11f20e04d925435cf22978c5d1a2f4d1f2637e05020384d7' 
  AND (
    token = '1sreG4fjoORXro/2w1yFPRywoCcPqESRrBxrtqPYkv8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029