UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dJBB9vnVg048KO1xdq8vCBsg/CrFranRFDEVlF6mStI=' 
WHERE 
  key_id = 'c19205df37c525b41e594b21e79665412f4d77d3da5ace8c83d179ef9f1b6841' 
  AND (
    token = 'dJBB9vnVg048KO1xdq8vCBsg/CrFranRFDEVlF6mStI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00071