UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kI9wezzyEjQaPR6+Y/Xw8vM0JvOHtgO3h+4f6BNFKF4=' 
WHERE 
  key_id = 'b231622244ef37c2988fdfb6b8f22bba4e3a336c7ac5c2c83c1cfb23dd155924' 
  AND (
    token = 'kI9wezzyEjQaPR6+Y/Xw8vM0JvOHtgO3h+4f6BNFKF4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042