UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9DA6Q/j0SwMcJWh36mvh8ekPCauXuG1LlhjcfHcbKSA=' 
WHERE 
  key_id = '78fd76fdd173316dabcc7121fceaef322bb95a45a6807a3f25067b68f5ae3a13' 
  AND (
    token = '9DA6Q/j0SwMcJWh36mvh8ekPCauXuG1LlhjcfHcbKSA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019