UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eo23E2XwV8PfzCTI7eVLr6GtAO63bYhFySw999qFhWI=' 
WHERE 
  key_id = '695f955e225f5c9eed42d96a8ff8a3acde2fb745ea4061dddd259fb27c03f60b' 
  AND (
    token = 'eo23E2XwV8PfzCTI7eVLr6GtAO63bYhFySw999qFhWI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035