UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zbF8DZKkY6P0RAPF+KjWS1PLimlstd0kH/9v3m+tK80=' 
WHERE 
  key_id = '0c626ec1fa40b05eb5c7a3a9edb44f147bb22c88d680a7c1a3b2dd2bbc597e56' 
  AND (
    token = 'zbF8DZKkY6P0RAPF+KjWS1PLimlstd0kH/9v3m+tK80=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030