UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iGpOb9gK/YhJS9ccZ63W4E3It7zwcTBnGi2YZsoqbAo=' 
WHERE 
  key_id = 'd962200aca4fb3f69d559c124cae7fbc2b8ef57b29f67bb4ab7517e347ea9039' 
  AND (
    token = 'iGpOb9gK/YhJS9ccZ63W4E3It7zwcTBnGi2YZsoqbAo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039