UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CgbdjETE+/9ISqh4UWSmResDm6iVD5mKGGBdPRBPk2c=' 
WHERE 
  key_id = 'def3772cb5efe64d0573da1733790d894c953f5b8934b4ea2855c603ab54dd7f' 
  AND (
    token = 'CgbdjETE+/9ISqh4UWSmResDm6iVD5mKGGBdPRBPk2c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040