UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MWCjE1DYec8A5jJKBDFEufjCop3IBTnfVSZHyOL+tAI=' 
WHERE 
  key_id = '46d15ed6c1959466413f332636445756612ab82abed1cfebb153fa0e3a32543b' 
  AND (
    token = 'MWCjE1DYec8A5jJKBDFEufjCop3IBTnfVSZHyOL+tAI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030