UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4UFn2sYIk81b5VyZpJ/3OxPLuofRECIUiCY/p/8/+RU=' 
WHERE 
  key_id = 'a83073b8eef81a6b1c6915a928f30b8dd33895cc75d49ed772e94e26336f7a59' 
  AND (
    token = '4UFn2sYIk81b5VyZpJ/3OxPLuofRECIUiCY/p/8/+RU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055