UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1C8KDnM8O1q1TkaJNcMuWCLEcYKsPTm1rgucrEJZLuM=' 
WHERE 
  key_id = '61b34efcd0fc69624b934ebc3711610e644fd18e1807adf845942cf83d058b16' 
  AND (
    token = '1C8KDnM8O1q1TkaJNcMuWCLEcYKsPTm1rgucrEJZLuM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026