UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H0NfdpZOtEcVYmxZnxjSLNOgr/P4DIt4Ik6vBU+7TOc=' 
WHERE 
  key_id = '9de16c9f3b6603dc153cf528536ba05e0b41a3230c9a8af9a2e86deee3a07d9e' 
  AND (
    token = 'H0NfdpZOtEcVYmxZnxjSLNOgr/P4DIt4Ik6vBU+7TOc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039