UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7YEwMLH+HT+eawimA5Xer9bxvyszoEMKTjNTrv7zTRc=' 
WHERE 
  key_id = 'd7299a3d60295f9848e327d03900348fb4367b4a83ef23e46fc2573f9b02751c' 
  AND (
    token = '7YEwMLH+HT+eawimA5Xer9bxvyszoEMKTjNTrv7zTRc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036