UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'itPBr4AbboSMhTO5jBSErQhFnZast1EJimfnYyjrLJQ=' 
WHERE 
  key_id = 'fd8163a940ecefa018956a733191737652d927c93b5b3723b8a92bd10c448e94' 
  AND (
    token = 'itPBr4AbboSMhTO5jBSErQhFnZast1EJimfnYyjrLJQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027