UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PWmy1uIlToL0a+8S/RlAD42ExchYYJkuAIs+rho7enI=' 
WHERE 
  key_id = 'ccfa4cba597d128d0a9ac4f76f6bf9da4aae6b997bb5d032bd1b1b89d09c9232' 
  AND (
    token = 'PWmy1uIlToL0a+8S/RlAD42ExchYYJkuAIs+rho7enI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00081