UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U76YC7E1SvTsagalZbcKij2yOzAthxjaqeEBx/0yYHY=' 
WHERE 
  key_id = '4404f53923f317171f8986136e4c6f2e74b10c3fcd03ff5ab6a5eeb7a488f292' 
  AND (
    token = 'U76YC7E1SvTsagalZbcKij2yOzAthxjaqeEBx/0yYHY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036