UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2PDef6VAFEM9NRFtv/vcqC1m5xnentWlGleo6SXfx/w=' 
WHERE 
  key_id = '1da6d2c79aad7c85deeb8e7e6272b95862488c29de949113bbf911fdba60edcf' 
  AND (
    token = '2PDef6VAFEM9NRFtv/vcqC1m5xnentWlGleo6SXfx/w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020